home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / AppleEvents.p < prev    next >
Encoding:
Text File  |  1991-04-05  |  19.9 KB  |  510 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {}
  4. {Created: Friday, January 11, 1991 at 3:01 PM}
  5. {    AppleEvents.p}
  6. {    Pascal Interface to the Macintosh Libraries}
  7. {}
  8. {        Copyright Apple Computer, Inc.    1989-1990}
  9. {        All rights reserved}
  10. {    }
  11. {}
  12.  
  13.  
  14. {$IFC UNDEFINED UsingIncludes}
  15. {$SETC UsingIncludes := 0}
  16. {$ENDC}
  17.  
  18.  
  19. unit AppleEvents;
  20. interface
  21.     uses
  22.         Types, Memory, OSUtils, Quickdraw, Events, Files, AppleTalk, PPCToolbox, Processes, EPPC, Notification;
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.     const
  52.         typeBoolean = 'bool';
  53.         typeChar = 'TEXT';
  54.         typeSMInt = 'shor';
  55.         typeInteger = 'long';
  56.         typeSMFloat = 'sing';
  57.         typeFloat = 'doub';
  58.         typeLongInteger = 'long';
  59.         typeShortInteger = 'shor';
  60.         typeLongFloat = 'doub';
  61.         typeShortFloat = 'sing';
  62.         typeExtended = 'exte';
  63.         typeComp = 'comp';
  64.         typeMagnitude = 'magn';
  65.         typeAEList = 'list';
  66.         typeAERecord = 'reco';
  67.         typeTrue = 'true';
  68.         typeFalse = 'fals';
  69.         typeAlias = 'alis';
  70.         typeEnumerated = 'enum';
  71.         typeType = 'type';
  72.         typeAppParameters = 'appa';
  73.         typeProperty = 'prop';
  74.         typeFSS = 'fss ';
  75.         typeKeyword = 'keyw';
  76.         typeSectionH = 'sect';
  77.         typeWildCard = '****';
  78.  
  79.         typeApplSignature = 'sign';
  80.         typeSessionID = 'ssid';
  81.         typeTargetID = 'targ';
  82.         typeProcessSerialNumber = 'psn ';
  83.         typeNull = 'null';                  {the type of null/nonexistent data}
  84.  
  85.         kCoreEventClass = 'aevt';
  86.  
  87.         kAEOpenApplication = 'oapp';
  88.         kAEOpenDocuments = 'odoc';
  89.         kAEPrintDocuments = 'pdoc';
  90.         kAEQuitApplication = 'quit';
  91.  
  92.         kAECreatorType = 'crea';
  93.         kAEQuitAll = 'quia';
  94.         kAEShutDown = 'shut';
  95.         kAERestart = 'rest';
  96.         kAEApplicationDied = 'obit';
  97.         keyProcessSerialNumber = 'psn ';
  98.  
  99.         keyErrorNumber = 'errn';
  100.         keyErrorString = 'errs';
  101.  
  102.         kAEAnswer = 'ansr';
  103.  
  104.         keyDirectObject = '----';
  105.  
  106.  
  107. { keyword used in install special handler }
  108.         keyPreDispatch = 'phac';            { PreHandler Accessor Call }
  109.         keySelectProc = 'selh';             { More selector Call }
  110.  
  111. { keywords used in attributes }
  112.         keyTransactionIDAttr = 'tran';
  113.         keyReturnIDAttr = 'rtid';
  114.         keyEventClassAttr = 'evcl';
  115.         keyEventIDAttr = 'evid';
  116.         keyAddressAttr = 'addr';
  117.         keyOptionalKeywordAttr = 'optk';
  118.         keyTimeoutAttr = 'timo';
  119.         keyInteractLevelAttr = 'inte';      {this attribute is read only will be set in AESend}
  120.         keyEventSourceAttr = 'esrc';        { this attribute is read only }
  121.         keyMissedKeywordAttr = 'miss';      { this attribute is read only }
  122.  
  123. { constants for use in AESendMode }
  124.         kAENoReply = $00000001;             { Sender doesn't want a reply to event }
  125.         kAEQueueReply = $00000002;          { Sender wants a reply but won't wait }
  126.         kAEWaitReply = $00000003;           { Sender wants a reply and will be waiting }
  127.  
  128.         kAENeverInteract = $00000010;       { Server should not interact with user }
  129.         kAECanInteract = $00000020;         { Server may try to interact with user }
  130.         kAEAlwaysInteract = $00000030;      { Server should always interact with user where appropriate }
  131.  
  132.         kAECanSwitchLayer = $00000040;      { Interaction may switch layer }
  133.  
  134.         kAEDontReconnect = $00000080;       { don't reconnect if there is a sessClosedErr from PPCToolbox }
  135.  
  136.         kAEWantReceipt = nReturnReceipt;    { Send wants a receipt of message }
  137.  
  138. { constants to be used in AESendPriority }
  139.         kAENormalPriority = $00000000;      { Post message at the end of event queue }
  140.         kAEHighPriority = nAttnMsg;         { Post message at the front of the event queue }
  141.  
  142. { special constants in generating events }
  143.         kAnyTransactionID = 0;              { no transaction is in use }
  144.         kAutoGenerateReturnID = -1;         { AECreateAppleEvent will generate a session-unique ID }
  145.  
  146. { constant for use AESend }
  147.         kAEDefaultTimeout = -1;             { timeout value determined by AEM }
  148.         kNoTimeOut = -2;                    { wait until reply comes back, however long it takes }
  149.  
  150. { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch}
  151. {table, or one of these two constants}
  152.         kAENoDispatch = 0;
  153.         kAEUseStandardDispatch = -1;
  154.  
  155. { Error messages in response to reading and writing event contents }
  156.         errAECoercionFail = -1700;
  157.         errAEDescNotFound = -1701;
  158.         errAECorruptData = -1702;
  159.         errAEWrongDataType = -1703;
  160.         errAENotAEDesc = -1704;
  161.         errAEBadListItem = -1705;           { Specified list item does not exist }
  162.         errAENewerVersion = -1706;          { Need newer version of AppleEvent Manager }
  163.         errAENotAppleEvent = -1707;         { The event is not in AppleEvent format }
  164.  
  165. { Error messages in response to sending/receiving a message }
  166.         errAEEventNotHandled = -1708;       { The AppleEvent was not handled by any handler }
  167.         errAEReplyNotValid = -1709;         { AEResetTimer was passed an invalid reply parameter }
  168.         errAEUnknownSendMode = -1710;       { Mode wasn't NoReply, WaitReply, or QueueReply;     or Interaction level is unknown }
  169.         errAEWaitCanceled = -1711;          { In AESend, User cancelled out of wait loop for  reply or receipt }
  170.         errAETimeout = -1712;               { AppleEvent timed out }
  171.  
  172.         errAENoUserInteraction = -1713;     { no user interaction allowed }
  173.         errAENotASpecialFunction = -1714;   { there is no special function with this keyword }
  174.         errAEParamMissed = -1715;           { a required parameter was not accessed }
  175.  
  176.         errAEUnknownAddressType = -1716;    { The target address type is not known }
  177.         errAEHandlerNotFound = -1717;       { No handler in the dispatch tables fits the parameters to}
  178. {                                              AEGetEventHandler or AEGetCoercionHandler}
  179.  
  180.         errAEReplyNotArrived = -1718;       { the contents of the reply you are accessing have not arrived yet }
  181.         errAEIllegalIndex = -1719;          { Index is out of range in a put operation }
  182.  
  183.     type
  184.         AEKeyword = packed array[1..4] of CHAR;
  185.         AEEventClass = packed array[1..4] of CHAR;
  186.         AEEventID = packed array[1..4] of CHAR;
  187.         DescType = ResType;
  188.  
  189. { tagged data, the standard AppleEvent data type }
  190.         AEDesc = record
  191.                 descriptorType: DescType;
  192.                 dataHandle: Handle;
  193.             end;
  194.  
  195.  
  196.         AEAddressDesc = AEDesc;             { an AEDesc which contains addressing data }
  197.         AEDescList = AEDesc;                { a list of AEDesc is a special kind of AEDesc }
  198.         AERecord = AEDescList;              { AERecord is a list of keyworded AEDesc }
  199.         AppleEvent = AERecord;              { an AERecord that contains an AppleEvent }
  200.         AESendMode = LONGINT;               { Type of parameter to AESend }
  201.         AESendPriority = INTEGER;           { Type of priority param of AESend }
  202.  
  203. { type of param to AEGetInteractionAllowed and AESetInteractionAllowed }
  204.         AEInteractAllowed = (kAEInteractWithSelf, kAEInteractWithLocal, kAEInteractWithAll);
  205.  
  206. { Return param to AEGetTheCurrentEvent, and kAEEventSource attribute }
  207.         AEEventSource = (kAEUnknownSource, kAEDirectCall, kAESameProcess, kAELocalProcess, kAERemoteProcess);
  208.  
  209.  
  210. { types for AppleEvent Array support }
  211. {}
  212. { Basic data type of attibutes & parameters}
  213.         AEKeyDesc = record
  214.                 descKey: AEKeyword;
  215.                 descContent: AEDesc;
  216.             end;
  217.  
  218.  
  219.         AEArrayType = (kAEDataArray, kAEPackedArray, kAEHandleArray, kAEDescArray, kAEKeyDescArray);
  220.  
  221.  
  222. { Array routines support these different types of elements}
  223.         AEArrayData = record
  224.                 case AEArrayType of
  225.                     kAEDataArray: (
  226.                             AEDataArray: array[0..0] of Integer
  227.                     );
  228.                     kAEPackedArray: (
  229.                             AEPackedArray: packed array[0..0] of Char
  230.                     );
  231.                     kAEHandleArray: (
  232.                             AEHandleArray: array[0..0] of Handle
  233.                     );
  234.                     kAEDescArray: (
  235.                             AEDescArray: array[0..0] of AEDesc
  236.                     );
  237.                     kAEKeyDescArray: (
  238.                             AEKeyDescArray: array[0..0] of AEKeyDesc
  239.                     );
  240.             end;
  241.  
  242.         AEArrayDataPointer = ^AEArrayData;
  243.  
  244.  
  245.  
  246.         EventHandlerProcPtr = ProcPtr;
  247.         IdleProcPtr = ProcPtr;
  248.         EventFilterProcPtr = ProcPtr;
  249.  
  250.  
  251. {   *********************************************************************}
  252. {The following calls apply to any AEDesc. Every result descriptor is created for you,}
  253. {so you will be responsible for memory management of the descriptors so created.}
  254. {Purgeable descriptor data is not supported: the AEM does not call LoadResource.}
  255.     function AECreateDesc (typeCode: DescType; dataPtr: Ptr; dataSize: Size; var result: AEDesc): OSErr;
  256.     inline
  257.         $303C, $0825, $A816;
  258.     function AECoercePtr (typeCode: DescType; dataPtr: Ptr; dataSize: Size; toType: DescType; var result: AEDesc): OSErr;
  259.     inline
  260.         $303C, $0A02, $A816;
  261.     function AECoerceDesc (theAEDesc: AEDesc; toType: DescType; var result: AEDesc): OSErr;
  262.     inline
  263.         $303C, $0603, $A816;
  264.     function AEDisposeDesc (var theAEDesc: AEDesc): OSErr;
  265.     inline
  266.         $303C, $0204, $A816;
  267.     function AEDuplicateDesc (theAEDesc: AEDesc; var result: AEDesc): OSErr;
  268.     inline
  269.         $303C, $0405, $A816;
  270.  
  271. { *********************************************************************}
  272. { The following calls apply to AEDescList.}
  273. {  Since AEDescList is a subtype of AEDesc, the calls in the previous}
  274. {  section can also be used for AEDescList. All list and array indices are 1-based.}
  275. {  If the data was greater than maximumSize in the routines below, then actualSize will}
  276. {  be greater than maximumSize, but only maximumSize bytes will actually be retrieved.}
  277.     function AECreateList (factoringPtr: Ptr; factoredSize: Size; isRecord: BOOLEAN; var resultList: AEDescList): OSErr;
  278.     inline
  279.         $303C, $0706, $A816;
  280.     function AECountItems (theAEDescList: AEDescList; var theCount: LONGINT): OSErr;
  281.     inline
  282.         $303C, $0407, $A816;
  283.     function AEPutPtr (theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr;
  284.     inline
  285.         $303C, $0A08, $A816;
  286.     function AEPutDesc (theAEDescList: AEDescList; index: LONGINT; theAEDesc: AEDesc): OSErr;
  287.     inline
  288.         $303C, $0609, $A816;
  289.     function AEGetNthPtr (theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; var theAEKeyword: AEKeyword; var typeCode: DescType; dataPtr: Ptr; maximumSize: Size; var actualSize: Size): OSErr;
  290.     inline
  291.         $303C, $100A, $A816;
  292.     function AEGetNthDesc (theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; var theAEKeyword: AEKeyword; var result: AEDesc): OSErr;
  293.     inline
  294.         $303C, $0A0B, $A816;
  295.     function AESizeOfNthItem (theAEDescList: AEDescList; index: LONGINT; var typeCode: DescType; var dataSize: Size): OSErr;
  296.     inline
  297.         $303C, $082A, $A816;
  298.     function AEGetArray (theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; maximumSize: Size; var itemType: DescType; var itemSize: Size; var itemCount: LONGINT): OSErr;
  299.     inline
  300.         $303C, $0D0C, $A816;
  301.     function AEPutArray (theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; itemType: DescType; itemSize: Size; itemCount: LONGINT): OSErr;
  302.     inline
  303.         $303C, $0B0D, $A816;
  304.     function AEDeleteItem (theAEDescList: AEDescList; index: LONGINT): OSErr;
  305.     inline
  306.         $303C, $040E, $A816;
  307.  
  308. { *********************************************************************}
  309. {The following calls apply to AERecord.}
  310. {  Since AERecord is a subtype of AEDescList, the calls in the previous}
  311. {  sections can also be used for AERecord}
  312. {  an AERecord can be created by using AECreateList with isRecord set to true}
  313.     function AEPutKeyPtr (theAERecord: AERecord; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr;
  314.     inline
  315.         $303C, $0A0F, $A816;
  316.     function AEPutKeyDesc (theAERecord: AERecord; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr;
  317.     inline
  318.         $303C, $0610, $A816;
  319.     function AEGetKeyPtr (theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: Ptr; maximumSize: Size; var actualSize: Size): OSErr;
  320.     inline
  321.         $303C, $0E11, $A816;
  322.     function AEGetKeyDesc (theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr;
  323.     inline
  324.         $303C, $0812, $A816;
  325.     function AESizeOfKeyDesc (theAERecord: AERecord; theAEKeyword: AEKeyword; var typeCode: DescType; var dataSize: Size): OSErr;
  326.     inline
  327.         $303C, $0829, $A816;
  328.     function AEDeleteKeyDesc (theAERecord: AERecord; theAEKeyword: AEKeyword): OSErr;
  329.     inline
  330.         $303C, $0413, $A816;
  331.  
  332. { }
  333. {    *********************************************************************}
  334. {    The following calls are used to pack and unpack parameters from records of}
  335. {    type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls in the previous}
  336. {    sections can also be used for variables of type AppleEvent. The next six calls}
  337. {    are in fact identical to the six calls for AERecord.}
  338. {}
  339.     function AEPutParamPtr (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr;
  340.     inline
  341.         $303C, $0A0F, $A816;
  342.     function AEPutParamDesc (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr;
  343.     inline
  344.         $303C, $0610, $A816;
  345.     function AEGetParamPtr (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: Ptr; maximumSize: Size; var actualSize: Size): OSErr;
  346.     inline
  347.         $303C, $0E11, $A816;
  348.     function AEGetParamDesc (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr;
  349.     inline
  350.         $303C, $0812, $A816;
  351.     function AESizeOfParam (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; var typeCode: DescType; var dataSize: Size): OSErr;
  352.     inline
  353.         $303C, $0829, $A816;
  354.     function AEDeleteParam (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  355.     inline
  356.         $303C, $0413, $A816;
  357.  
  358. { *********************************************************************}
  359. {The following calls also apply to type AppleEvent.  Message attributes are far more restricted, and}
  360. {can only be accessed through the following 5 calls. The various list and record routines cannot be used}
  361. {to access the attributes of an event.}
  362.     function AEGetAttributePtr (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: Ptr; maximumSize: Size; var actualSize: Size): OSErr;
  363.     inline
  364.         $303C, $0E15, $A816;
  365.     function AEGetAttributeDesc (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr;
  366.     inline
  367.         $303C, $0826, $A816;
  368.     function AESizeOfAttribute (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; var typeCode: DescType; var dataSize: Size): OSErr;
  369.     inline
  370.         $303C, $0828, $A816;
  371.     function AEPutAttributePtr (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: Ptr; dataSize: Size): OSErr;
  372.     inline
  373.         $303C, $0A16, $A816;
  374.     function AEPutAttributeDesc (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr;
  375.     inline
  376.         $303C, $0627, $A816;
  377.  
  378. { *********************************************************************}
  379. { The next four calls are basic routines used to create, send, and process AppleEvents.}
  380.     function AECreateAppleEvent (theAEEventClass: AEEventClass; theAEEventID: AEEventID; target: AEAddressDesc; returnID: INTEGER; transactionID: LONGINT; var result: AppleEvent): OSErr;
  381.     inline
  382.         $303C, $0B14, $A816;
  383.     function AESend (theAppleEvent: AppleEvent; var reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LONGINT; idleProc: IdleProcPtr; filterProc: EventFilterProcPtr): OSErr;
  384.     inline
  385.         $303C, $0D17, $A816;
  386.     function AEProcessAppleEvent (theEventRecord: EventRecord): OSErr;
  387.     inline
  388.         $303C, $021B, $A816;
  389.  
  390. { During event processing, an event handler may realize that it is likely}
  391. {to exceed the client's timeout limit. Passing the reply to this}
  392. {routine causes a wait event to be generated to ask the client for more time.}
  393.     function AEResetTimer (reply: AppleEvent): OSErr;
  394.     inline
  395.         $303C, $0219, $A816;
  396.  
  397. {   *********************************************************************}
  398. {The following four calls are available for applications which need more sophisticated control}
  399. {over when and how events are processed. Applications which implement multi-session servers or }
  400. {which implement their own internal event queueing will probably be the major clients of these}
  401. {routines.  }
  402. {}
  403. { Can be called from within a handler to prevent the AEM from disposing of}
  404. {the AppleEvent when the handler returns. Can be used to asynchronously process the }
  405. {event (as in MacApp).}
  406.     function AESuspendTheCurrentEvent (theAppleEvent: AppleEvent): OSErr;
  407.     inline
  408.         $303C, $022B, $A816;
  409.  
  410. { }
  411. {     Tells the AppleEvent manager that processing is either about to resume or has}
  412. {    been completed on a previously suspended event. The procPtr passed in as the}
  413. {    dispatcher parameter will be called to attempt to redispatch the event. Several}
  414. {    constants for the dispatcher parameter allow special behavior. They are:}
  415. {    - kAEUseStandardDispatch means redispatch as if the event was just received, using the}
  416. {        standard AppleEvent Dispatcher.}
  417. {    - kAENoDispatch means ignore the parameter.}
  418. {        Use this in the case where no redispatch is needed, and the event has been handled.}
  419. {    - non nil means call the routine which dispatcher points to.}
  420. {}
  421.     function AEResumeTheCurrentEvent (theAppleEvent: AppleEvent; reply: AppleEvent; dispatcher: EventHandlerProcPtr; handlerRefcon: LONGINT): OSErr;
  422.     inline
  423.         $303C, $0818, $A816;
  424.  
  425. { Allows application to examine the currently executing event }
  426.     function AEGetTheCurrentEvent (var theAppleEvent: AppleEvent): OSErr;
  427.     inline
  428.         $303C, $021A, $A816;
  429.  
  430. { Set the current event to the parameter }
  431.     function AESetTheCurrentEvent (theAppleEvent: AppleEvent): OSErr;
  432.     inline
  433.         $303C, $022C, $A816;
  434.  
  435. { }
  436. {    *********************************************************************}
  437. {     The following three calls are used to allow applications to behave courteously }
  438. {    when a user interaction such as a dialog box is needed. }
  439. {}
  440.     function AEGetInteractionAllowed (var level: AEInteractAllowed): OSErr;
  441.     inline
  442.         $303C, $021D, $A816;
  443.     function AESetInteractionAllowed (level: AEInteractAllowed): OSErr;
  444.     inline
  445.         $303C, $011E, $A816;
  446.     function AEInteractWithUser (timeOutInTicks: LONGINT; nmReqPtr: NMRecPtr; idleProc: IdleProcPtr): OSErr;
  447.     inline
  448.         $303C, $061C, $A816;
  449.  
  450. {  *********************************************************************}
  451. { These calls are used to set up and modify the event dispatch table}
  452.  
  453. { Add an AppleEvent Handler  }
  454.     function AEInstallEventHandler (theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: EventHandlerProcPtr; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  455.     inline
  456.         $303C, $091F, $A816;
  457.  
  458. {  Remove an AppleEvent Handler  }
  459.     function AERemoveEventHandler (theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: EventHandlerProcPtr; isSysHandler: BOOLEAN): OSErr;
  460.     inline
  461.         $303C, $0720, $A816;
  462.  
  463. {  Get the corresponding AppleEvent Handler  }
  464.     function AEGetEventHandler (theAEEventClass: AEEventClass; theAEEventID: AEEventID; var handler: EventHandlerProcPtr; var handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  465.     inline
  466.         $303C, $0921, $A816;
  467.  
  468. {  *********************************************************************}
  469. { These calls are used to set up and modify the coercion dispatch table}
  470.     function AEInstallCoercionHandler (fromType: DescType; toType: DescType; handler: ProcPtr; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  471.     inline
  472.         $303C, $0A22, $A816;
  473.  
  474. {  Remove a Coercion Handler  }
  475.     function AERemoveCoercionHandler (fromType: DescType; toType: DescType; handler: ProcPtr; isSysHandler: BOOLEAN): OSErr;
  476.     inline
  477.         $303C, $0723, $A816;
  478.  
  479. {  Get the corresponding Coercion Handler  }
  480.     function AEGetCoercionHandler (fromType: DescType; toType: DescType; var handler: ProcPtr; var handlerRefcon: LONGINT; var fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  481.     inline
  482.         $303C, $0B24, $A816;
  483.  
  484. { }
  485. {      *********************************************************************}
  486. {    These calls are used to set up and modify special hooks into the AppleEvent Manager.}
  487. {}
  488. {    Install the special handler named by the Keyword}
  489.     function AEInstallSpecialHandler (functionClass: AEKeyword; handler: ProcPtr; isSysHandler: BOOLEAN): OSErr;
  490.     inline
  491.         $303C, $0500, $A816;
  492.  
  493. {  Remove the special handler named by the Keyword  }
  494.     function AERemoveSpecialHandler (functionClass: AEKeyword; handler: ProcPtr; isSysHandler: BOOLEAN): OSErr;
  495.     inline
  496.         $303C, $0501, $A816;
  497.  
  498. {  Get the special handler named by the Keyword  }
  499.     function AEGetSpecialHandler (functionClass: AEKeyword; var handler: ProcPtr; isSysHandler: BOOLEAN): OSErr;
  500.     inline
  501.         $303C, $052D, $A816;
  502.  
  503.  
  504.     { UsingAppleEvents }
  505.  
  506.  
  507. implementation
  508. end.
  509.  
  510.